package cn.ywsj.ywsjmidtier.entity.VO;

import cn.ywsj.ywsjmidtier.entity.BaseGroup;
import cn.ywsj.ywsjmidtier.entity.UserInfoGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @ClassName : CaptchaVo
 * @Author : Lenovo
 * @Date: 2021/7/19 11:11
 * @Description :
 */
@Data
public class CaptchaVo {
    @NotBlank(message = "{com.itonghui.validator.sysCode.null}", groups = {BaseGroup.Query.class})
    @Length(min = 1, max = 6, message = "{org.hibernate.validator.constraints.Length.message}", groups = {BaseGroup.Query.class})
    private String sysCode;

    @NotNull(message = "{com.itonghui.user.account.null}", groups = {BaseGroup.Query.class, BaseGroup.Insert.class, UserInfoGroup.UsersmsCodeUpdate.class})
    @Pattern(regexp = "^((\\+86)?(13\\d|14[5-9]|15[0-35-9]|166|17[0-8]|18\\d|19[1-8-9])\\d{8})$", message = "{com.itonghui.user.account.regexp}", groups = {BaseGroup.Query.class, BaseGroup.Insert.class, UserInfoGroup.UsersmsCodeUpdate.class})
    private String cellphone;

    @NotNull(groups = {BaseGroup.Query.class, BaseGroup.Insert.class, UserInfoGroup.UsersmsCodeUpdate.class})
    @Max(value = 10L, groups = {BaseGroup.Query.class, BaseGroup.Insert.class, UserInfoGroup.UsersmsCodeUpdate.class})
    private Integer type;
}
